# def fibonacciSum(n):
#     if n == 0:
#         return 0
#     a, b = 1, 1
#     total = a
#     for i in range(2, n + 1):
#         c = a + b
#         total += c
#         a, b = b, c
#     return total
# x = eval(input("请输入一个值："))
# s = print(fibonacciSum(x))
# print("前{}个数总和是{}".format(x,s))



# def fibonacciNum(n):
#     if n == 1 or n == 2:
#         return 1
#     else:
#     return fibonacciNum(n - 1) + fibonacciNum(n - 2)

# s = eval(input("请输入一个值："))
# x = print(fibonacciNum(s))
# print("第{}个数是{}".format(s,x))


def fn(n):
    if n == 1 or n == 2:
        return 1
    else:
        return fn(n-1)+fn(n-2)
n = eval(input("请输入一个整数："))
print("斐波那契数列的第{}个数是：{}".format(n,fn(n)))

def fs(n):
    sum = 0
    for i in range(1,n+1):
        s = fn(i)
       # print(s)
        sum += s
    return sum
print("斐波那契数列的前{}个数的总和是：{}".format(n,fs(n)))